var request=new XMLHttpRequest();
function crea(){
    request.open('GET','http://localhost:8080/contador/crea/'+document.getElementById('counter').value, true);
    hecho();
    request.send(null);
}

function inc(){
    request.open('GET','http://localhost:8080/contador/suma/'+document.getElementById('counter').value, true);
    hecho();
    request.send(null);
}

function hecho(){
    if ((request.readyState == 4 && (request.status == 200)) {alert('Hecho');}
}
